package com.songpeng.provider.demo.service;


import business.service.OrderService;
import business.service.StorageService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service
public class BusinessService {
    @DubboReference
    private StorageService storageService;
    @DubboReference
    private OrderService orderService;

    /**
     * 采购
     */
    public void purchase(String userId, String commodityCode, int orderCount) {

        storageService.deduct(commodityCode, orderCount);

        orderService.create(userId, commodityCode, orderCount);
    }
}
